import request from '@/utils/request'

// 查询关联属性列表
export function listObjectProperty(query) {
  return request({
    url: '/system/objectProperty/list',
    method: 'get',
    params: query
  })
}

// 查询关联属性列表个数
export function listObjectPropertyCount(query) {
    return request({
        url: '/system/objectProperty/listCount',
        method: 'get',
        params: query
    })
}


// 查询关联属性详细
export function getObjectProperty(id) {
  return request({
    url: '/system/objectProperty/' + id,
    method: 'get'
  })
}

// 新增关联属性
export function addObjectProperty(data) {
  return request({
    url: '/system/objectProperty',
    method: 'post',
    data: data
  })
}

// 修改关联属性
export function updateObjectProperty(data) {
  return request({
    url: '/system/objectProperty',
    method: 'put',
    data: data
  })
}

// 删除关联属性
export function delObjectProperty(id) {
  return request({
    url: '/system/objectProperty/' + id,
    method: 'delete'
  })
}

// 导出关联属性
export function exportObjectProperty(query) {
  return request({
    url: '/system/objectProperty/export',
    method: 'get',
    params: query
  })
}

// 新增字段判重
export function addRemovingRepeat(classesId, nameEn) {
  return request({
    url: '/system/objectProperty/addRemovingRepeat/'+classesId+"/"+nameEn,
    method: 'get'
  })
}

//===========关联数据查询========================

//关联数据list
export function associationList(query) {
  return request({
    url: '/system/objectProperty/associationList',
    method: 'get',
    params: query
  })
}

export function associationRemove(data) {
  return request({
    url: '/system/objectProperty/associationRemove',
    method: 'post',
    data: data
  })
}

export function associationAdd(data) {
  return request({
    url: '/system/objectProperty/associationAdd',
    method: 'post',
    data: data
  })
}

